package com.xiaoyg.lession01.chapter17;

/**
 * 当前线程是否停止，当前的线程是mian，所以一直为false
 */
public class Run {

    public static void main(String[] args) {
        try {
            MyThread thread = new MyThread();
            thread.start();
            Thread.sleep(1000);
            thread.interrupt();
            System.out.println("是否停止1? ="+thread.interrupted());
            System.out.println("是否停止2? ="+thread.interrupted());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
